#ifndef __IS_CORE_RAYTRACE_PRIMITIVES__
#define __IS_CORE_RAYTRACE_PRIMITIVES__

namespace IS
{

class Sphere
{
public:
// Construction
	Sphere(const Vec3f& _center, float _radius)
		: center(_center), radius(_radius)
	{}

// Attribute
	Vec3f center;	//<! Center of the Sphere.
	float radius;	//<! Radius of the Sphere.

};	// Sphere

class Box
{
public:
// Construction
	Box(const Vec3f& _center, const Vec3f& _extends)
		: center(_center), extends(_extends)
	{}

// Attribute
	Vec3f center;	//<! Center of the Box.
	Vec3f extends;	//<! Distance from the center to each side.

};	// Box

class TriangleBase
{
protected:
	MCD_INLINE2 void _getPlane(const Vec3f& a, const Vec3f& b, const Vec3f& c, Plane& outPlane) const
	{
		outPlane = Plane(a, b, c);
	}
};	// TriangleBase

class RefTriangle : public TriangleBase
{
public:

// Construction
	RefTriangle(const Vec3f& a, const Vec3f& b, const Vec3f& c)
	{
		vertex[0] = &a;
		vertex[1] = &b;
		vertex[2] = &c;
	}

// Operation
	MCD_INLINE2 void getPlane(Plane & outPlane) const
	{
		_getPlane(*vertex[0], *vertex[1], *vertex[2], outPlane);
	}

// Attribute
	Vec3f const * vertex[3];	//<! Reference to 3 existing vertices

};	// RefTriangle

class Triangle : public TriangleBase
{
public:

// Construction
	Triangle(const Vec3f& a, const Vec3f& b, const Vec3f& c)
	{
		vertex[0] = a;
		vertex[1] = b;
		vertex[2] = c;
	}

// Operation
	MCD_INLINE2 void getPlane(Plane & outPlane) const
	{
		_getPlane(vertex[0], vertex[1], vertex[2], outPlane);
	}

// Attribute
	Vec3f vertex[3];	//<! The 3 vertices

};	// Triangle

}	// namespace IS

#endif	// __IS_CORE_RAYTRACE_PRIMITIVES__